/*返回一个数组，其内容是把原数组中对应元素的平均海拔转换成其对应的轨道周期.*/

function orbitalPeriod(arr) {
    var GM = 398600.4418;
    var earthRadius = 6367.4447;
    function change(avgAlt) {
        var r = earthRadius + avgAlt;
        var b = Math.pow(r, 3) / GM;
        var T = 2 * Math.PI * Math.pow(b, 0.5);
        return Math.round(T);
    }
    var result = [];
    for (var i in arr) {
        var a = change(arr[i].avgAlt);
        var dict = {};
        dict.name = arr[i].name;
        dict.orbitalPeriod = a;
        result.push(dict);
    }
    return result;
}
